-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix bug #54379 PDO_OCI: UTF-8 output gets truncated #2276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Tagging Christopher as he is the Oracle guy; @cjbj |
Ping @cjbj |
I'm back; I've asked a developer to look at this. It's in a big queue of tasks TBD. |
S->cols[colno].datalen *= 3; | ||
} | ||
|
||
S->cols[colno].datalen *= S->H->max_char_width; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 602-606 need to be:
} else if (dtype == SQLT_BIN){
S->cols[colno].datalen = (ub4) col->maxlen * 2; // raw characters to hex digits
} else {
S->cols[colno].datalen = (ub4) (col->maxlen * S->H->max_char_width);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rationale from the developer who looked at it is:
"Given raw data(SQLT_BIN) is defined as SQLT_CHR (See line #609), raw is returned as strings. So 1 byte raw is represented as two bytes of hex digits.
For example, a 1-byte raw data 'FF' is converted to two 'F' characters. So we need to multiply by 2 (not 3) to accommodate the translation of raw to hex digits. max_char_width
should be used for character strings.
Apart from that, other changes all look good including the testcase. The test would normally be skipped in the test suite as a UTF-8 DSN is required.
But we can see the skip reason in the test result and run it manually if required."
No update from filer on this. But no fear! We've got a corrected patch ready for testing and merge. I'll close this PR |
Comment on behalf of sixd at php.net: We will commit a corrected patch |
This was a modification of an incomplete PR #2276.
Replacement for issue #542